<head>
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  {{ if or .Params.author .Site.Author.name }} {{/* author */}}
    <meta name="author" content="{{- or .Params.author .Site.Author.name -}}">
  {{ end }}

  {{ if or .Keywords .Site.Params.keywords }} {{/* keywords */}}
    {{ $keywords := slice }}
    {{ with .Params.keywords }}
    {{ $keywords = . }}
    {{ else }}
    {{ with .Site.Params.keywords }}
    {{ $keywords = . }}
    {{ end }}
    {{ end }}
    <meta name="keywords" content="{{ range $index, $value := $keywords }}{{ if gt $index 0 }},{{ end }}{{ $value }}{{ end }}">
  {{ end }}

  {{ if or .Description .Site.Params.description }} {{/* description*/}}
    <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
  {{ end }}

  {{ hugo.Generator }}
  
  
  {{ $title := .Site.Title }}
  {{ with .Params.Title }}
  {{ $title = printf "%s 🌟 %s" . $title }}
  {{ end }}
  <title>{{- $title -}}</title>

  {{ template "_internal/opengraph.html" . }}
  {{ template "_internal/twitter_cards.html" . }}

  {{/* style */}}
  {{ $sass := resources.Get "scss/index/index.scss" }}
  {{ $options := dict "targetPath" "assets/css/style.min.css" "outputStyle" "compressed" }}
  {{ $style := $sass | resources.ToCSS $options | resources.Fingerprint "sha256" }}
  <link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">

  {{/* script */}}
  {{- $js := resources.Get "ts/main.ts" -}}
  {{- $opts := dict "targetPath" "assets/js/main.min.js" "minify" hugo.IsProduction -}}
  {{- $script := $js | js.Build $opts | resources.Fingerprint "sha256" -}}
  <script src="{{ $script.Permalink }}" integrity="{{ $script.Data.Integrity }}"></script>
  
  {{ with .OutputFormats.Get "rss" -}}
  {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
  {{ end -}}
</head>